﻿//========================================================================
// *作者：海盗猫  主页：ilplay.com
// *脚本：EditorFileProcess
// *描述：EditorFileProcess
// *?2024 HDMCode . All rights reserved.
//* ======================================================================
using UnityEditor;

namespace HDMCode.UIFrameEditor
{
    public class EditorFileProcess:AssetPostprocessor
    {
        public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            foreach (var fileItem in movedAssets)
            {
                if (fileItem.EndsWith(".prefab"))
                {
                    var guids = AssetDatabase.AssetPathToGUID(fileItem);
                    if (EditorHelper.ContainsSettingByGuid(guids,out _))
                    {
                        EditorUtility.DisplayDialog("重命名警告：", "当前资源为UI框架资源，修改资源名称或将会导致该资源失效！", "明白");
                    }
                }
            }
        }
    }
}
